home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17897 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!devmaccn.demon.co.uk
  2. From: Alan Griffiths <aGriffiths@ma.ccngroup.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Templates as the type of a template
  5. Date: Wed, 17 Apr 1996 17:22:13 GMT
  6. Organization: CCN Market Analysis
  7. Distribution: world
  8. Message-ID: <493104333wnr@ma.ccngroup.com>
  9. References: <316D1587.167EB0E7@kainos.com>
  10. Reply-To: aGriffiths@ma.ccngroup.com
  11. X-NNTP-Posting-Host: devmaccn.demon.co.uk
  12. X-Broken-Date: Wednesday, Apr 17, 1996 17.22.13 GMT
  13. X-Newsreader: Newswin Alpha 0.6
  14. X-Mail2News-Path: devmaccn.demon.co.uk
  15.  
  16. In article: <316D1587.167EB0E7@kainos.com>  Andrew Palmer <a.palmer@kainos.com> writes:
  17. > Hello,
  18. >   I'm using Sun's CC compiler from Sparcworks 3.0.1 and I'm having a
  19. > little trouble passing a template class as the type of another template
  20. > class.
  21. >   I have one template class called "list" and I can use "list<int> foo"
  22. > fine.
  23. >   I have another template class called "vector" and I can use
  24. > "vector<int> bar;" fine as well.
  25. >   But I don't seem to be able to have a list of vectors of type int,
  26. > e.g. "list<vector<int>> foobar;" doesn't work.
  27.  
  28. C++ syntax requires a whitespace. vis: "list<vector<int> >"
  29.  
  30. >   I can get round the problem by "typedef vector<int> iVector;
  31. > list<iVector> foobar;"
  32. >   Am I doing something wrong in the syntax or is it just one of those
  33. > things that doesn't work?
  34.  
  35. Can't speak for your compiler.
  36.  
  37.  
  38. Alan Griffiths               | Also editor of: The ISDF Newsletter
  39. Senior Systems Consultant,   | (An Association of C and C++ Users publication)
  40. CCN Group Limited.           | (ISDF editor  : isdf@octopull.demon.co.uk)
  41. (agriffiths@ma.ccngroup.com) | (For ACCU see : http://bach.cis.temple.edu/accu)
  42.  
  43.